package springtive.test;

public class WebView
{
	private WebViewClient webViewClient;
	

	public WebViewClient getWebViewClient()
	{
		return webViewClient;
	}

	public void setWebViewClient(WebViewClient webViewClient)
	{
		this.webViewClient = webViewClient;
	}
	
	public static void main(String[] args)
	{
		WebView webView = new WebView();
		webView.setWebViewClient(new WebViewClient() {
			@Override
			public void onPageStart(String url) {
				System.out.println("My onPageStart");
				super.onPageStart(url);
			}
			
			@Override
			public void shouldOverrideUrlLoading(String url) {
				System.out.println("My shouldOverrideUrlLoading");
				super.shouldOverrideUrlLoading(url);
			}
			
			@Override
			public void onPageFinished(String url) {
				super.onPageFinished(url);
				System.out.println("My onPageFinished");
			}
		});
		
		webView.setWebViewClient(new WebViewClient());
		
		webView.execute("http://www.naver.com");
	}

	private void execute(String url)
	{
		if (webViewClient != null)
			webViewClient.onPageStart(url);
		
		if (webViewClient != null)
			webViewClient.shouldOverrideUrlLoading(url);
		
		if (webViewClient != null)
			webViewClient.onPageFinished(url);
	}

}
